package com.zhong.gang.applib.ui.adapter;

import android.view.ViewGroup;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhong.gang.applib.utils.DensityUtil;
import com.zhong.gang.applib.utils.GlideUtils;
import com.zhong.gang.applib.R;

public class ImgAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    private boolean isBig;
    public ImgAdapter(boolean isBig) {
        super(R.layout.item_img);
        this.isBig = isBig;
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        GlideUtils.show(mContext,item,(ImageView) helper.getView(R.id.image));
        int size = DensityUtil.dip2px(mContext,isBig? 60:45);
        ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,size);
        helper.getView(R.id.layout).setLayoutParams(params);
    }
}
